package com.mia.props.common;

import com.mia.props.common.entities.TileBaseSwitchable;
import com.mia.props.common.entities.TileBed;
import com.mia.props.common.entities.TileChair;
import com.mia.props.common.entities.TileContainer;
import com.mia.props.common.entities.TileDecobench;
import com.mia.props.common.entities.TileDoor;
import com.mia.props.common.entities.TileFaucet;
import com.mia.props.common.entities.TileMountable;
import com.mia.props.common.entities.TileParticleEmitter;
import com.mia.props.common.entities.TileParticleEmitterSwitchable;
import com.mia.props.common.entities.TileRecordPlayer;
import com.mia.props.common.entities.TileShowerHandles;
import com.mia.props.common.entities.TileShowerHead;
import com.mia.props.common.entities.TileSwitchableLamp;
import com.mia.props.common.entities.TileVariableRendering;
import cpw.mods.fml.common.registry.GameRegistry;
import java.util.ArrayList;
import java.util.List;

public enum TileTypeMap {
   Props(TileProps.class, new String[]{"TileBirdFountain"}),
   BaseSwitchable(TileBaseSwitchable.class, new String[0]),
   Bed(TileBed.class, new String[0]),
   Chair(TileChair.class, new String[0]),
   Container(TileContainer.class, new String[0]),
   Decobench(TileDecobench.class, new String[0]),
   Mountable(TileMountable.class, new String[0]),
   ShowerHandles(TileShowerHandles.class, new String[0]),
   ShowerHead(TileShowerHead.class, new String[0]),
   SwitchableLamp(TileSwitchableLamp.class, new String[0]),
   ParticleEmitter(TileParticleEmitter.class, new String[]{"TileChandelier", "TileChemistrySet", "TileCrystalChandelier", "TileCandleStick", "TileCandleWall"}),
   ParticleEmitterSwitchable(TileParticleEmitterSwitchable.class, new String[0]),
   Faucet(TileFaucet.class, new String[]{"TileKitchenFaucetInward", "TileKitchenFaucetOutward", "TileSinkFaucetInward", "TileSinkFaucetOutward", "TileTubFaucet"}),
   VariableRendering(TileVariableRendering.class, new String[0]),
   RecordPlayer(TileRecordPlayer.class, new String[0]),
   Door(TileDoor.class, new String[0]);

   private Class clazz;
   private String[] altnames;

   private TileTypeMap(Class clazz, String... altnames) {
      this.clazz = clazz;
      this.altnames = altnames;
   }

   public Class getTileClass() {
      return this.clazz;
   }

   public static TileTypeMap getTileType(Class clazz) {
      TileTypeMap[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         TileTypeMap type = var1[var3];
         if (type.clazz == clazz) {
            return type;
         }
      }

      return Props;
   }

   public static void register() {
      TileTypeMap[] var0 = values();
      int var1 = var0.length;

      for(int var2 = 0; var2 < var1; ++var2) {
         TileTypeMap type = var0[var2];
         List altNames = new ArrayList();
         altNames.add(type.clazz.getSimpleName());
         altNames.add(type.clazz.getCanonicalName().replace(".common.", "."));
         String[] var5 = type.altnames;
         int var6 = var5.length;

         for(int var7 = 0; var7 < var6; ++var7) {
            String s = var5[var7];
            altNames.add("com.mia.props.common.entities." + s);
            altNames.add("com.mia.props.entities." + s);
         }

         GameRegistry.registerTileEntityWithAlternatives(type.clazz, type.clazz.getCanonicalName(), (String[])altNames.toArray(new String[0]));
      }

   }
}
